import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_demo/navigation/tab_navigation.dart';
import 'package:flutter_demo/provider/globle_model.dart';
import 'package:flutter_demo/provider_widget.dart';
import 'package:flutter_demo/store/provider_store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

void main() {
  runApp(ProviderWidget<GlobalModel>(model: GlobalModel(), builder: (context, model, child) {
    return Store.init(child: MyApp());
  },));
  //Flutter沉浸式状态栏
  if (Platform.isAndroid) {
    SystemChrome.setSystemUIOverlayStyle(
        SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  }
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: Size(750, 1334),
      allowFontScaling: false,
      builder: () => MaterialApp(
        debugShowCheckedModeBanner: false,
        title: '集合版',
        home: TabNavigation(),
      ),
    );
  }
}
